package SI::Person::InsurInfo;

use base qw/MyDB::Object/;



__PACKAGE__->meta->setup(
    table => 'InsurInfo',
    columns => [
        base_sn => {type=>'varchar', length=>16, not_null=>1},
        insur_firsttime => {type=>'datetime', not_null=>1},
        account_firsttime => {type=>'datetime',not_null=>1},
    ],
    allow_inline_column_values => 1,
    primary_key_columns => [ 'base_sn' ],
);


sub int_tab {
	my $self = shift;
	my $stmt = 'CREATE TABLE IF NOT EXISTS InsurInfo (
                base_sn VARCHAR(16) PRIMARY KEY NOT NULL, /* 人员序列号     */
                insur_firsttime DATE ,                    /* 首次参保日期   */
                account_firsttime DATE                    /* 首次记账户日期 */
                );';
    my $db = $self->init_db;
    my $dbh = $db->dbh or die $db->error;
    $db->do_transaction(sub {$dbh->do($stmt)})
        or die $db->error;
    return 1;
}







1;
